label: Fix a potential memory leak
authorTimm Bäder <mail@baedert.org>
Sun, 10 Jan 2021 09:12:08 +0000 (10:12 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 17 Jan 2021 03:39:26 +0000 (04:39 +0100)
This only happens in error cases so not very interesting. Anyway, try to
make scan-build happy.

gtk/gtklabel.c

index 1c8a31f2314b85eb73d3a54d603fd3b6687f1b50..0ed845678705777a7d64bfc4e879731cd0dd327f 100644 (file)
@@ -3500,7 +3500,10 @@ no_uline:
       /* Extract the text to display */
       if (!pango_parse_markup (new_text, -1, '_',
                                do_mnemonics ? &attrs : NULL, &text, NULL, &error))
-        goto error_set;
+        {
+          g_free (new_text);
+          goto error_set;
+        }
 
       if (do_mnemonics)
         {